package com.thf.controller;

import com.thf.model.EchartsOneModel;
import com.thf.model.ResultData;
import com.thf.service.EchartsOneExcelUploadService;
import com.thf.service.impl.EchartsOneServiceImpl;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

//@DefaultProperties(defaultFallback = "defaultFallback")
@RestController
public class EchartsController {
    @Resource
    private EchartsOneExcelUploadService echartsOneExcelUploadService;
    @Resource
    private EchartsOneServiceImpl echartsOneService;
    @RequestMapping("/insertAll")
    public ResultData insertAll(@RequestBody List<EchartsOneModel> list){
        return echartsOneExcelUploadService.insertAll(list);
    }
    @RequestMapping("/findAll")
    public ResultData<Map<String, Object>> findAll(){
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        return echartsOneService.findAll();
    }
    @RequestMapping("/find")
    public List<EchartsOneModel> find(){
        return echartsOneService.find();
    }
}
